using System;
using Comdiv.Extensions;
using Comdiv.Model;
using Comdiv.Model.Interfaces;
using Comdiv.Logging;
using Comdiv.Application;
using Comdiv.Persistence;
using Comdiv.Inversion;
using Comdiv.Security.Acl;
using Comdiv.Conversations;
using Comdiv.IO;
using Comdiv.Security;
using System.Linq;

namespace Comdiv.Messaging{
    /// <summary>
    /// Implements IMessageQueryInterface + floint
    /// </summary>
    public class MessageQuery : IMessageQuery {
        public MessageQuery(){
            //DEFAULT QUERY IS ALL SENDED TO ME
            //default usr is current
            this.Usr = myapp.usrName;
            //no hql/sql by default
            this.NativeQuery = "";
            //current usr as target by default
            this.Target = myapp.usrName;
            //sender is any by default
            this.Sender = "";
            //current domain is unknown
            this.Domain = "";
            //default type is "all"
            this.Type = "";
            //broadcastes are used
            this.ShowBroadCasts = true;
            //inactives and archives are ignored
            this.ShowInactive = false;
            this.ShowArchived = false;
            //readed are shown
            this.ShowReaded = true;
        }

        public string Usr
        {
            get; set;
        }

        public string NativeQuery { get; set; }
        public string Sender { get; set; }
        public string Domain { get; set; }
        public string Type { get; set; }
        public string Target { get; set; }
        public bool ShowBroadCasts { get; set; }
        public bool ShowReaded { get; set; }
        public bool ShowArchived { get; set; }
        public bool ShowInactive { get; set; }
        public bool AnyTarget
        {
            get; set;
        }
    }
}